//  -------------------------------------------------------------------------
//  Copyright (C) 2017 BMW Car IT GmbH
//  -------------------------------------------------------------------------
//  This Source Code Form is subject to the terms of the Mozilla Public
//  License, v. 2.0. If a copy of the MPL was not distributed with this
//  file, You can obtain one at https://mozilla.org/MPL/2.0/.
//  -------------------------------------------------------------------------

#pragma once

#include "IRendererTest.h"

#include <string>

namespace ramses::internal
{
    class RenderTargetRenderingTests : public IRendererTest
    {
    public:
        void setUpTestCases(RendererTestsFramework& testFramework) final;
        bool run(RendererTestsFramework& testFramework, const RenderingTestCase& testCase) final;

    private:
        template <typename INTEGRATION_SCENE>
        bool runBasicTest(RendererTestsFramework& testFramework, uint32_t sceneState, const std::string& expectedImageName, float maxAveragePercentErrorPerPixel = RendererTestUtils::DefaultMaxAveragePercentPerPixel);

        enum
        {
            RenderTarget_Perspective,
            RenderTarget_Orthographic,

            RenderTarget_Format_RGBA4,
            RenderTarget_Format_R8,
            RenderTarget_Format_RG8,
            RenderTarget_Format_RGB8,
            RenderTarget_Format_R16F,
            RenderTarget_Format_R32F,
            RenderTarget_Format_RG16F,
            RenderTarget_Format_RG32F,
            RenderTarget_Format_RGB16F,
            RenderTarget_Format_RGB32F,
            RenderTarget_Format_RGBA16F,
            RenderTarget_Format_RGBA32F,

            MultipleRenderTarget_TwoColorBuffersCleared,
            MultipleRenderTarget_TwoColorBuffersWritten,
            MultipleRenderTarget_TwoColorBuffersWrittenRGBA8_RGBA4,
            MultipleRenderTarget_ShaderWritesTwoColorBuffers_RTHasOnlyOne,
            MultipleRenderTarget_ReuseSameColorBufferInTwoRTs,
            MultipleRenderTarget_ReuseSameDepthBufferInTwoRTs,
            MultipleRenderTarget_ReadFromDepth,

            RenderBuffer_OneColorBufferNoDepthOrStencil,
            RenderBuffer_OneColorBufferWithWriteOnlyDepthBuffer,
            RenderBuffer_OneColorBufferWithWriteOnlyDepthStencilBuffer,
            RenderBuffer_OneColorBufferWithWriteOnlyDepth16,
            RenderBuffer_OneColorBufferWithWriteOnlyDepth24,
            RenderBuffer_ReadWriteDepth16,
            RenderBuffer_ReadWriteDepth24,
            RenderBuffer_ReadWriteDepth32,
            RenderBuffer_MsaaSampleCount1Blit,
            RenderBuffer_MsaaSampleCount2Blit,
            RenderBuffer_MsaaSampleCount4Blit,
            RenderBuffer_MsaaSampleCount4TexelFetch
        };
    };
}
